from django.contrib.auth.models import AbstractUser
from django.db import models

# Create your models here.
class UserInfo(AbstractUser):
    user_name = models.CharField(max_length=32)
    user_sex = models.CharField(max_length=32)
    user_birth = models.CharField(max_length=32)
    user_phone = models.CharField(max_length=32)
    user_email = models.CharField(max_length=32)
    user_birthplace = models.CharField(max_length=32)
    user_unit = models.CharField(max_length=32)
    user_photo = models.ImageField(upload_to='user_photos/',blank=True,null=True)

class Appraising(models.Model):
    id = models.AutoField(primary_key=True)
    user_id = models.ForeignKey(to='UserInfo', on_delete=models.CASCADE)
    app_name = models.CharField(max_length=32)
    app_data = models.CharField(max_length=32)
    app_status = models.IntegerField(default=0)

class Picture(models.Model):
    id = models.AutoField(primary_key=True)
    app_id = models.ForeignKey(to='Appraising',on_delete=models.CASCADE)
    photo = models.ImageField(upload_to='photos/',blank=True,null=True)
